//
//  InspectionTests.m
//  InspectionTests
//
//  Created by blue on 2013-11-10.
//  Copyright (c) 2013 Blue. All rights reserved.
//

#import "GameStateTest.h"
#import "GameState.h"

@implementation GameStateTest

- (void)setUp
{
    [super setUp];
    
    // Set-up code here.
}

- (void)tearDown
{
    // Tear-down code here.
    
    [super tearDown];
}

- (void)testInitialState
{
    GameState *state = [GameState sharedGameState];
    STAssertEquals([state getScore], 0, @"Score not being initialized properly.");
}

-(void)testUsername
{
    GameState *state = [GameState sharedGameState];
    STAssertNotNil([state userName], @"Username cannot be nil.");
}

- (void)testScoreReset
{
    GameState *state = [GameState sharedGameState];
    [state incScore];
    [state resetScore];
    STAssertEquals([state getScore], 0, @"Score not being reset properly.");
}

- (void)testScoreIncrement
{
    GameState *state = [GameState sharedGameState];
    [state incScore];
    [state incScore];
    STAssertEquals([state getScore], 2, @"Score not being incremented properly.");
    [state resetScore];
}

- (void)testScoreDecrement
{
    GameState *state = [GameState sharedGameState];
    [state decScore];
    STAssertEquals([state getScore], -1, @"Score not being decremented properly.");
    [state resetScore];
}

-(void)testScore
{
    GameState *state = [GameState sharedGameState];
    [state incScore]; [state incScore]; [state incScore];
    [state decScore];
    [state resetScore];
    [state incScore]; [state incScore];
    [state decScore];
    STAssertEquals([state getScore], 1, @"Score method error.");
    [state resetScore];
}





@end
